<?php

foreach($quotes as $quote)
{
    $tags = trim($quote['Quote']['tags']);
    $tags = ($tags == '') ? array() : explode(' ', $tags);
    sort($tags);

    echo $quote['Quote']['body'] . "\n\n-- Wookiee' QDB (" . implode(' ', $tags) . ")\n%\n";
}

?>